<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Comunicacion</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Comunicacion</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/app/models/comunicacion_rb.html">
                app/models/comunicacion.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                ActiveRecord::Base
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000216">get_form_html_id</a>&nbsp;&nbsp;
      <a href="#M000206">get_mod_comunicacion</a>&nbsp;&nbsp;
      <a href="#M000217">get_name</a>&nbsp;&nbsp;
      <a href="#M000207">listas_contactos</a>&nbsp;&nbsp;
      <a href="#M000208">listas_cuentas_pos_ing</a>&nbsp;&nbsp;
      <a href="#M000209">listas_cuentas_ven_ing</a>&nbsp;&nbsp;
      <a href="#M000214">search</a>&nbsp;&nbsp;
      <a href="#M000212">search_con</a>&nbsp;&nbsp;
      <a href="#M000213">search_con_hist</a>&nbsp;&nbsp;
      <a href="#M000210">search_cuenta</a>&nbsp;&nbsp;
      <a href="#M000215">search_fin</a>&nbsp;&nbsp;
      <a href="#M000211">search_tipo</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000206" class="method-detail">
        <a name="M000206"></a>

        <div class="method-heading">
          <a href="#M000206" class="method-signature">
          <span class="method-name">get_mod_comunicacion</span><span class="method-args">(user)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000206-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000206-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/comunicacion.rb, line 11</span>
11:         <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_mod_comunicacion</span>(<span class="ruby-identifier">user</span>)
12:                 <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">role_user</span>.<span class="ruby-identifier">descripcion</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">'Invitado'</span> <span class="ruby-keyword kw">then</span>
13:                         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
14:                 <span class="ruby-keyword kw">else</span>
15:                <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> 
16:                 <span class="ruby-keyword kw">end</span>           
17:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000207" class="method-detail">
        <a name="M000207"></a>

        <div class="method-heading">
          <a href="#M000207" class="method-signature">
          <span class="method-name">listas_contactos</span><span class="method-args">(cuenta)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000207-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000207-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/comunicacion.rb, line 20</span>
20:         <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">listas_contactos</span>(<span class="ruby-identifier">cuenta</span>)
21:                 <span class="ruby-ivar">@contactos_ids</span> = <span class="ruby-constant">Comunicacion</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">'cuenta_id = ?'</span>,<span class="ruby-identifier">cuenta</span>.<span class="ruby-identifier">id</span>] ).<span class="ruby-identifier">collect</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">:contacto_id</span>)
22:                 <span class="ruby-ivar">@contactos</span> = <span class="ruby-constant">Contacto</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">'id in (?)'</span>,<span class="ruby-ivar">@contactos_ids</span>])
23:                 <span class="ruby-ivar">@contactos</span> = <span class="ruby-ivar">@contactos</span>.<span class="ruby-identifier">uniq</span>   
24:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000208" class="method-detail">
        <a name="M000208"></a>

        <div class="method-heading">
          <a href="#M000208" class="method-signature">
          <span class="method-name">listas_cuentas_pos_ing</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000208-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000208-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/comunicacion.rb, line 26</span>
26:         <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">listas_cuentas_pos_ing</span>()      
27:                 <span class="ruby-ivar">@cuentas_pos</span> = <span class="ruby-constant">Posicionamiento</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>).<span class="ruby-identifier">collect</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">:cuenta</span>) 
28:                 <span class="ruby-ivar">@cuentas_ing</span> = <span class="ruby-constant">Ingreso</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>).<span class="ruby-identifier">collect</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">:cuenta</span>) 
29:                 <span class="ruby-ivar">@cuentas</span> = <span class="ruby-ivar">@cuentas_ing</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cuentas_pos</span> 
30:                 <span class="ruby-ivar">@cuentas</span> = <span class="ruby-ivar">@cuentas</span>.<span class="ruby-identifier">uniq</span>      
31:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000209" class="method-detail">
        <a name="M000209"></a>

        <div class="method-heading">
          <a href="#M000209" class="method-signature">
          <span class="method-name">listas_cuentas_ven_ing</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000209-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000209-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/comunicacion.rb, line 33</span>
33:         <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">listas_cuentas_ven_ing</span>()      
34:                 <span class="ruby-ivar">@cuentas_ven</span> = <span class="ruby-constant">Venta</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>).<span class="ruby-identifier">collect</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">:cuenta</span>) 
35:                 <span class="ruby-ivar">@cuentas_ing</span> = <span class="ruby-constant">Ingreso</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>).<span class="ruby-identifier">collect</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">:cuenta</span>) 
36:                 <span class="ruby-ivar">@cuentas</span> = <span class="ruby-ivar">@cuentas_ven</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cuentas_ing</span> 
37:                 <span class="ruby-ivar">@cuentas</span> = <span class="ruby-ivar">@cuentas</span>.<span class="ruby-identifier">uniq</span>      
38:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000214" class="method-detail">
        <a name="M000214"></a>

        <div class="method-heading">
          <a href="#M000214" class="method-signature">
          <span class="method-name">search</span><span class="method-args">(page, cuenta_id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000214-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000214-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/comunicacion.rb, line 62</span>
62:         <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">search</span>(<span class="ruby-identifier">page</span>, <span class="ruby-identifier">cuenta_id</span>)
63:                 <span class="ruby-identifier">paginate</span> <span class="ruby-identifier">:per_page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">3</span>, <span class="ruby-identifier">:page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">page</span>,
64:                          <span class="ruby-identifier">:order</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'fecha DESC'</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">'cuenta_id = '</span><span class="ruby-operator">+</span><span class="ruby-identifier">cuenta_id</span>]
65:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000212" class="method-detail">
        <a name="M000212"></a>

        <div class="method-heading">
          <a href="#M000212" class="method-signature">
          <span class="method-name">search_con</span><span class="method-args">(page, contacto_id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000212-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000212-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/comunicacion.rb, line 51</span>
51:         <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">search_con</span>(<span class="ruby-identifier">page</span>, <span class="ruby-identifier">contacto_id</span>)
52:                 <span class="ruby-identifier">paginate</span> <span class="ruby-identifier">:per_page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">3</span>, <span class="ruby-identifier">:page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">page</span>,
53:                          <span class="ruby-identifier">:order</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'fecha DESC'</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">'contacto_id = '</span><span class="ruby-operator">+</span><span class="ruby-identifier">contacto_id</span>]
54:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000213" class="method-detail">
        <a name="M000213"></a>

        <div class="method-heading">
          <a href="#M000213" class="method-signature">
          <span class="method-name">search_con_hist</span><span class="method-args">(page, contacto_id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000213-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000213-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/comunicacion.rb, line 56</span>
56:         <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">search_con_hist</span>(<span class="ruby-identifier">page</span>, <span class="ruby-identifier">contacto_id</span>)
57:                 <span class="ruby-identifier">paginate</span> <span class="ruby-identifier">:per_page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">6</span>, <span class="ruby-identifier">:page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">page</span>,
58:                          <span class="ruby-identifier">:order</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'type'</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">'contacto_id = '</span><span class="ruby-operator">+</span><span class="ruby-identifier">contacto_id</span>]
59:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000210" class="method-detail">
        <a name="M000210"></a>

        <div class="method-heading">
          <a href="#M000210" class="method-signature">
          <span class="method-name">search_cuenta</span><span class="method-args">(page, cuenta_id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000210-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000210-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/comunicacion.rb, line 40</span>
40:         <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">search_cuenta</span>(<span class="ruby-identifier">page</span>, <span class="ruby-identifier">cuenta_id</span>)
41:                 <span class="ruby-identifier">paginate</span> <span class="ruby-identifier">:per_page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">5</span>, <span class="ruby-identifier">:page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">page</span>,
42:                          <span class="ruby-identifier">:order</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'fecha DESC'</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">'cuenta_id = '</span><span class="ruby-operator">+</span><span class="ruby-identifier">cuenta_id</span><span class="ruby-operator">+</span><span class="ruby-value str">' AND (type = &quot;Venta&quot; OR type = &quot;Ingreso&quot;)'</span>]
43:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000215" class="method-detail">
        <a name="M000215"></a>

        <div class="method-heading">
          <a href="#M000215" class="method-signature">
          <span class="method-name">search_fin</span><span class="method-args">(page)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000215-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000215-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/comunicacion.rb, line 68</span>
68:         <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">search_fin</span>(<span class="ruby-identifier">page</span>)
69:           <span class="ruby-identifier">venta</span> = <span class="ruby-value str">'Venta'</span>
70:           <span class="ruby-identifier">ingreso</span> = <span class="ruby-value str">'Ingreso'</span>
71:                 <span class="ruby-identifier">paginate</span> <span class="ruby-identifier">:per_page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">5</span>, <span class="ruby-identifier">:page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">page</span>,
72:                          <span class="ruby-identifier">:order</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'fecha DESC'</span>,<span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">&quot;type = 'Venta' OR type = 'Ingreso'&quot;</span>] 
73:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000211" class="method-detail">
        <a name="M000211"></a>

        <div class="method-heading">
          <a href="#M000211" class="method-signature">
          <span class="method-name">search_tipo</span><span class="method-args">(page, tipo)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000211-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000211-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/comunicacion.rb, line 45</span>
45:         <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">search_tipo</span>(<span class="ruby-identifier">page</span>, <span class="ruby-identifier">tipo</span>)
46:                 <span class="ruby-identifier">paginate</span> <span class="ruby-identifier">:per_page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">5</span>, <span class="ruby-identifier">:page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">page</span>,
47:                          <span class="ruby-identifier">:order</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'fecha DESC'</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">'type = '</span><span class="ruby-operator">+</span><span class="ruby-value str">'&quot;'</span><span class="ruby-operator">+</span><span class="ruby-identifier">tipo</span><span class="ruby-operator">+</span><span class="ruby-value str">'&quot;'</span>]
48:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000216" class="method-detail">
        <a name="M000216"></a>

        <div class="method-heading">
          <a href="#M000216" class="method-signature">
          <span class="method-name">get_form_html_id</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000216-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000216-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/comunicacion.rb, line 75</span>
75:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_form_html_id</span> 
76:                 <span class="ruby-value str">''</span>
77:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000217" class="method-detail">
        <a name="M000217"></a>

        <div class="method-heading">
          <a href="#M000217" class="method-signature">
          <span class="method-name">get_name</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000217-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000217-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/comunicacion.rb, line 79</span>
79:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_name</span> 
80:                 <span class="ruby-value str">'fixme'</span>
81:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>